package com.yan.controller;

import com.yan.beans.AllInfo;
import com.yan.beans.AppInfo;
import com.yan.beans.WebAppInfo;
import com.yan.service.AppInfoService;
import com.yan.utils.RedisUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2019/12/6 0006.
 */


@Controller
@RequestMapping("appInfo")
public class AppInfoController {

    @Resource
   private  AppInfoService appInfoService;
    @Resource
    private RedisUtil redisUtil;
    @RequestMapping("getInfo")
    @ResponseBody
    public   AppInfo getAppInfo(){
        return appInfoService.getAppInfo();
    }
    @RequestMapping("/app/{info}")
    @ResponseBody
    public String setInfo(@PathVariable String info){
        redisUtil.set("app",info);
        return "123";
    }
    @RequestMapping("/getWebInfo")
    @ResponseBody
    public List<WebAppInfo> getWebInfo(){
        return appInfoService.getWebInfo();
    }

    @RequestMapping("/getAll")
    @ResponseBody
    public AllInfo getAll(){
        return appInfoService.getAllInfo();
    }

}
